<?php
apf_require_class("Bll_BLL");
class Bll_Jx_Log extends BLL{
	public function get_person_login_log($userId){
		return $this->get_current_dao()->find(array('userId'=>$userId),array("logintime desc"));
	}
	public function get_current_dao(){
		return $this->get_dao("Dao_jx_LoginInfo");
	}
	public function get_login_user_info($user_id,$userName,$ip){
		$user_info=$this->get_dao("Dao_jx_UserPerformance")->find_row(array("userId"=>$user_id));
		$this->insert_login_log($user_info["userId"],$userName,$user_info["cityName"], $ip, $user_info["cityName"]);
	}
	public function insert_login_log($userId,$userName,$city,$ip,$companyName){
		$log=array("userId"=>$userId,"userName"=>$userName,"city"=>$city,"ip"=>$ip,"companyName"=>$companyName,"logintime"=>date('Y-m-d H:m:s',time()));
		$this->get_current_dao()->insert($log);
	}
}
